var channelId;

window.onload = function () {
    channelId = getQuery("id");
}
function add() {
    axios.get("/post/add",{
        params: {
            postName:$("addPostName").value,
            postContent:$("addPostContent").value,
            channel:channelId
        }
    }).then(resp=>{
        var info = resp.data;
        if (info=="noland"){
            location.href="/login.html?errorInfo=noland";
        }
        else  {
            var str = "";
            str+=`/post.html?id=${channelId}`;
            location.href = str;
        }
    });

}